package com.soccertgc.logging 
{
	
	public class TraceLogTarget extends LogTarget
	{
		
		// -------------------------------------------------------------------------------
		// CONSTANTS
		// -------------------------------------------------------------------------------
		
		
		// -------------------------------------------------------------------------------
		// CONSTRUCTOR
		// -------------------------------------------------------------------------------
		
		public function TraceLogTarget(options:LogTargetParams)
		{
			super(LogTargetType.TRACE, options);
		}
		
		// -------------------------------------------------------------------------------
		// PRIVATE METHODS
		// -------------------------------------------------------------------------------
		
		override protected function write(message:String):void
		{ 
			// Check if the message contains the internal handling for multilines
			if (isMultiline(message))
			{
				// Splits the lines
				var lines:Array = split(message);
				// Trace each line
				for (var i:int = 0; i < lines.length; i++) trace(lines[i]);
			}
			else
			{
				// Trace the whole message
				trace(message);				
			}
		}
		
	}
}